package Encapsulation.封装;


interface Animal{

    void shout();

}
public class NOuter {

    public static void animalShout(Animal a){
        a.shout();
    }

    public static void main(String[] args) {

        String name = "小明";
        animalShout(new Animal() {
            @Override
            public void shout() {
                System.out.println(name+"汪汪汪叫个不停！");
            }
        });

        animalShout(()-> System.out.println("lambda表达式输出："+name+"汪汪汪叫个不停！！！"));

    }
}
